package com.shine.design.pattern.guide.factory;

import org.junit.Test;

/**
 * @Description:
 * @CreateTime: 2023/8/27 13:36
 * @Version:
 * @Since: 1.8
 * @Author: Forward Seen
 */
public class FactoryTest {
    @Test
    public void getInstanceFromFactory() {
        System.out.println("-----------shape-----------");
        Shape circle = ShapeFactory.getShape("CIRCLE");
        circle.draw();
        System.out.println("-----------shapeFactory-----------");
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape square = shapeFactory.getShape("SQUARE");
        square.draw();
        Shape rectangle = shapeFactory.getShape("RECTANGLE");
        rectangle.draw();
    }
}